package com.xzy.learn.spring.bean.destroy.bean;

import com.xzy.learn.spring.entity.Student;
import org.springframework.beans.factory.DisposableBean;

import javax.annotation.PreDestroy;

/**
 * @author xzy.xiao
 * @date 2022/6/1  17:07
 */
public class StudentH extends Student implements DisposableBean {

    @PreDestroy
    public void destroyByPreDestroyAnnotation() {
        System.out.println("destroy bean by StudentH::destroyByPreDestroyAnnotation()");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("destroy bean by StudentH::destroy()");
    }

    public void myDestroy() throws Exception {
        System.out.println("destroy bean by StudentH::myDestroy()");
    }
}
